package com.winz.cultureapp.adapter;

import android.content.Context;
import android.graphics.Color;
import android.os.Build;
import android.view.View;
import android.widget.TextView;

import com.winz.cultureapp.R;
import com.winz.cultureapp.base.AbsBaseAdapter;
import com.winz.cultureapp.entity.PublicGnBean;

/**
 * 场馆筛选栏--功能选择
 */
public class PublicGnAdapter extends AbsBaseAdapter<PublicGnBean.DataBean.ListBean>{

    public PublicGnAdapter(Context context, boolean isNeedToRemember, int resid) {
        super(context, isNeedToRemember, resid);
    }

    @Override
    public void bindDatas(int position, View convertView, ViewHolder viewHolder, PublicGnBean.DataBean.ListBean data) {
        TextView textView = viewHolder.getView(R.id.tv_name);
        viewHolder.bindTextView(R.id.tv_name,data.categoryName);
        if(map_isSelected.get(position).isSelected()){
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                textView.setTextColor(context.getColor(R.color.base_color));
            }else{
                textView.setTextColor(Color.parseColor("#34AD78"));
            }
            viewHolder.getView(R.id.tv_name).setBackgroundResource(R.drawable.buttom_reset);
        }else {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
                textView.setTextColor(context.getColor(R.color.text_66));
            }else{
                textView.setTextColor(Color.parseColor("#666666"));
            }
            viewHolder.getView(R.id.tv_name).setBackgroundResource(R.drawable.buttom_grey);
        }
    }
}
